package com.freshfresh.utils;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.SharedPreferences;

import com.hangyjx.util.AndroidUtil;

public class FreshConstants {
	public static final String LOCAL_SHOPPINGCAR = "local_shoppingcar";
	public static final String LOCAL_SHOPPINGCARUPDATE = "local_shoppingcarupdate";
	public static final String ADD_SERVER_SHOPPINGCAR = "add_server_shoppingcar";
	public static final String UPDATELOCAL_SHOPPINGCAR = "updatelocal_shopping";
	public static final String LOGOUT = "logout";
	/**
	 * 登陆成功后存储用户信息
	 * @param userid
	 * @param token
	 * @param mobile
	 * @param sex
	 * @param birthday
	 * @param head_url
	 * @param quoteid  购物车id
	 * @throws Exception
	 */
	public static SharedPreferences getUserShared(Activity ac) {
		SharedPreferences shared=ac.getSharedPreferences("user", ac.MODE_PRIVATE);
		return shared;
	}
	public static boolean hasLogined(Activity ac) {
		SharedPreferences shared=ac.getSharedPreferences("user", ac.MODE_PRIVATE);
		String userid=shared.getString("userid", "-1");
		if(userid.equals("-1")){
			return false;
		}else{
			return true;
		}
	}

}
